<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        li {
            float: left;
            margin: 10px;
        }

        input {
            display: none;
        }

        label {
            display: block;
            width: 100px;
            height: 40px;
            text-align: center;
            line-height: 40px;
            border: 1px solid #000;
            cursor: pointer;
        }

        input:checked+label {
            border: 1px solid #f00;
            color: red;
        }

        /* input:checked ~ img {
            display: block;
        } */
        
    </style>
</head>

<body>
    <ul>
        <li>
            <input type="radio" name="a" id="a1">
            <label for="a1">白色</label>

        </li>
        <li>
            <input type="radio" name="a" id="a2">
            <label for="a2">黑色</label>
        </li>
        <li>
            <input type="radio" name="a" id="a3">
            <label for="a3">红色</label>
        </li>
    </ul>
</body>

</html>